package com.itgaoshu.hospitalproject.mapper;
import com.itgaoshu.hospitalproject.bean.CCashier;
import com.itgaoshu.hospitalproject.bean.ReportVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface CTakeMapper {
    @Select("select r.reportId,r.reportName,r.phone,r.carid,r.sex,r.age,e.department,d.doctorName,t.type,r.zhuan,r.time,r.price from report r,doctor d,departments e,registeredtype t where r.doctor=d.doctorId and r.department=e.departmentId and r.reportType=t.registeredId and r.state=3")
    List<ReportVo> selectCTake();

    @Select("select * from cashier where reportId=#{perid}")
    List<CCashier> selCCa(int perid);

    @Select("select sum(repicetotal) from  cashier where  reportId=#{reid}")
    int countzong(int reid);
    //药品出库修改用户状态
    @Update("update report set state=2 WHERE reportId=#{reportId}")
    Integer chuku(int reportId);
}
